3.256 \(\int \frac{\sec (e+f x)}{(a+b \sec (e+f x)) (c+d \sec (e+f x))} \, dx\)

Optimal. Leaf size=121 \[ \frac{2 b \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a+b}}\right )}{f \sqrt{a-b} \sqrt{a+b} (b c-a d)}-\frac{2 d \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{f \sqrt{c-d} \sqrt{c+d} (b c-a d)} \]

[Out]

(2*b*ArcTanh[(Sqrt[a - b]*Tan[(e + f*x)/2])/Sqrt[a + b]])/(Sqrt[a - b]*Sqrt[a + b]*(b*c - a*d)*f) - (2*d*ArcTa
nh[(Sqrt[c - d]*Tan[(e + f*x)/2])/Sqrt[c + d]])/(Sqrt[c - d]*Sqrt[c + d]*(b*c - a*d)*f)

________________________________________________________________________________________

Rubi [A]  time = 0.274576, antiderivative size = 121, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.129, Rules used = {3988, 3001, 2659, 208} \[ \frac{2 b \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a+b}}\right )}{f \sqrt{a-b} \sqrt{a+b} (b c-a d)}-\frac{2 d \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{f \sqrt{c-d} \sqrt{c+d} (b c-a d)} \]

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]/((a + b*Sec[e + f*x])*(c + d*Sec[e + f*x])),x]

[Out]

(2*b*ArcTanh[(Sqrt[a - b]*Tan[(e + f*x)/2])/Sqrt[a + b]])/(Sqrt[a - b]*Sqrt[a + b]*(b*c - a*d)*f) - (2*d*ArcTa
nh[(Sqrt[c - d]*Tan[(e + f*x)/2])/Sqrt[c + d]])/(Sqrt[c - d]*Sqrt[c + d]*(b*c - a*d)*f)

Rule 3988

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]
*(d_.) + (c_))^(n_), x_Symbol] :> Dist[1/g^(m + n), Int[(g*Csc[e + f*x])^(m + n + p)*(b + a*Sin[e + f*x])^m*(d
 + c*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] && NeQ[b*c - a*d, 0] && IntegerQ[m] && Inte
gerQ[n]

Rule 3001

Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])/(((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.)
+ (f_.)*(x_)])), x_Symbol] :> Dist[(A*b - a*B)/(b*c - a*d), Int[1/(a + b*Sin[e + f*x]), x], x] + Dist[(B*c - A
*d)/(b*c - a*d), Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0]
 && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rubi steps

\begin{align*} \int \frac{\sec (e+f x)}{(a+b \sec (e+f x)) (c+d \sec (e+f x))} \, dx &=\int \frac{\cos (e+f x)}{(b+a \cos (e+f x)) (d+c \cos (e+f x))} \, dx\\ &=\frac{b \int \frac{1}{b+a \cos (e+f x)} \, dx}{b c-a d}-\frac{d \int \frac{1}{d+c \cos (e+f x)} \, dx}{b c-a d}\\ &=\frac{(2 b) \operatorname{Subst}\left (\int \frac{1}{a+b+(-a+b) x^2} \, dx,x,\tan \left (\frac{1}{2} (e+f x)\right )\right )}{(b c-a d) f}-\frac{(2 d) \operatorname{Subst}\left (\int \frac{1}{c+d+(-c+d) x^2} \, dx,x,\tan \left (\frac{1}{2} (e+f x)\right )\right )}{(b c-a d) f}\\ &=\frac{2 b \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b} (b c-a d) f}-\frac{2 d \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{\sqrt{c-d} \sqrt{c+d} (b c-a d) f}\\ \end{align*}

Mathematica [A]  time = 0.231845, size = 119, normalized size = 0.98 \[ -\frac{2 b \tanh ^{-1}\left (\frac{(b-a) \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a^2-b^2}}\right )}{f \sqrt{a^2-b^2} (b c-a d)}-\frac{2 d \tanh ^{-1}\left (\frac{(d-c) \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c^2-d^2}}\right )}{f \sqrt{c^2-d^2} (a d-b c)} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[e + f*x]/((a + b*Sec[e + f*x])*(c + d*Sec[e + f*x])),x]

[Out]

(-2*b*ArcTanh[((-a + b)*Tan[(e + f*x)/2])/Sqrt[a^2 - b^2]])/(Sqrt[a^2 - b^2]*(b*c - a*d)*f) - (2*d*ArcTanh[((-
c + d)*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]])/((-(b*c) + a*d)*Sqrt[c^2 - d^2]*f)

________________________________________________________________________________________

Maple [A]  time = 0.083, size = 108, normalized size = 0.9 \begin{align*}{\frac{1}{f} \left ( -2\,{\frac{b}{ \left ( ad-bc \right ) \sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}{\it Artanh} \left ({\frac{ \left ( a-b \right ) \tan \left ( 1/2\,fx+e/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }+2\,{\frac{d}{ \left ( ad-bc \right ) \sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) } \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)/(a+b*sec(f*x+e))/(c+d*sec(f*x+e)),x)

[Out]

1/f*(-2*b/(a*d-b*c)/((a+b)*(a-b))^(1/2)*arctanh((a-b)*tan(1/2*f*x+1/2*e)/((a+b)*(a-b))^(1/2))+2*d/(a*d-b*c)/((
c+d)*(c-d))^(1/2)*arctanh(tan(1/2*f*x+1/2*e)*(c-d)/((c+d)*(c-d))^(1/2)))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)/(a+b*sec(f*x+e))/(c+d*sec(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 6.49626, size = 2214, normalized size = 18.3 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)/(a+b*sec(f*x+e))/(c+d*sec(f*x+e)),x, algorithm="fricas")

[Out]

[-1/2*((a^2 - b^2)*sqrt(c^2 - d^2)*d*log((2*c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos(f*x + e)^2 + 2*sqrt(c^2 - d^2
)*(d*cos(f*x + e) + c)*sin(f*x + e) + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d^2)) + (b*c^2 -
 b*d^2)*sqrt(a^2 - b^2)*log((2*a*b*cos(f*x + e) - (a^2 - 2*b^2)*cos(f*x + e)^2 - 2*sqrt(a^2 - b^2)*(b*cos(f*x
+ e) + a)*sin(f*x + e) + 2*a^2 - b^2)/(a^2*cos(f*x + e)^2 + 2*a*b*cos(f*x + e) + b^2)))/(((a^2*b - b^3)*c^3 -
(a^3 - a*b^2)*c^2*d - (a^2*b - b^3)*c*d^2 + (a^3 - a*b^2)*d^3)*f), -1/2*((a^2 - b^2)*sqrt(c^2 - d^2)*d*log((2*
c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos(f*x + e)^2 + 2*sqrt(c^2 - d^2)*(d*cos(f*x + e) + c)*sin(f*x + e) + 2*c^2
- d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d^2)) - 2*(b*c^2 - b*d^2)*sqrt(-a^2 + b^2)*arctan(-sqrt(-a^2
 + b^2)*(b*cos(f*x + e) + a)/((a^2 - b^2)*sin(f*x + e))))/(((a^2*b - b^3)*c^3 - (a^3 - a*b^2)*c^2*d - (a^2*b -
 b^3)*c*d^2 + (a^3 - a*b^2)*d^3)*f), -1/2*(2*(a^2 - b^2)*sqrt(-c^2 + d^2)*d*arctan(-sqrt(-c^2 + d^2)*(d*cos(f*
x + e) + c)/((c^2 - d^2)*sin(f*x + e))) + (b*c^2 - b*d^2)*sqrt(a^2 - b^2)*log((2*a*b*cos(f*x + e) - (a^2 - 2*b
^2)*cos(f*x + e)^2 - 2*sqrt(a^2 - b^2)*(b*cos(f*x + e) + a)*sin(f*x + e) + 2*a^2 - b^2)/(a^2*cos(f*x + e)^2 +
2*a*b*cos(f*x + e) + b^2)))/(((a^2*b - b^3)*c^3 - (a^3 - a*b^2)*c^2*d - (a^2*b - b^3)*c*d^2 + (a^3 - a*b^2)*d^
3)*f), -((a^2 - b^2)*sqrt(-c^2 + d^2)*d*arctan(-sqrt(-c^2 + d^2)*(d*cos(f*x + e) + c)/((c^2 - d^2)*sin(f*x + e
))) - (b*c^2 - b*d^2)*sqrt(-a^2 + b^2)*arctan(-sqrt(-a^2 + b^2)*(b*cos(f*x + e) + a)/((a^2 - b^2)*sin(f*x + e)
)))/(((a^2*b - b^3)*c^3 - (a^3 - a*b^2)*c^2*d - (a^2*b - b^3)*c*d^2 + (a^3 - a*b^2)*d^3)*f)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec{\left (e + f x \right )}}{\left (a + b \sec{\left (e + f x \right )}\right ) \left (c + d \sec{\left (e + f x \right )}\right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)/(a+b*sec(f*x+e))/(c+d*sec(f*x+e)),x)

[Out]

Integral(sec(e + f*x)/((a + b*sec(e + f*x))*(c + d*sec(e + f*x))), x)

________________________________________________________________________________________

Giac [B]  time = 1.34189, size = 710, normalized size = 5.87 \begin{align*} \frac{\frac{{\left (\sqrt{-c^{2} + d^{2}} b{\left (c - 2 \, d\right )}{\left | c - d \right |} + \sqrt{-c^{2} + d^{2}} a d{\left | c - d \right |} + \sqrt{-c^{2} + d^{2}}{\left | -b c + a d \right |}{\left | c - d \right |}\right )}{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor + \arctan \left (\frac{2 \, \sqrt{\frac{1}{2}} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-\frac{2 \, a c - 2 \, b d + \sqrt{-4 \,{\left (a c + b c + a d + b d\right )}{\left (a c - b c - a d + b d\right )} + 4 \,{\left (a c - b d\right )}^{2}}}{a c - b c - a d + b d}}}\right )\right )}}{{\left (b c - a d\right )}^{2}{\left (c^{2} - 2 \, c d + d^{2}\right )} +{\left (c^{3} - 2 \, c^{2} d + c d^{2}\right )} a{\left | -b c + a d \right |} -{\left (c^{2} d - 2 \, c d^{2} + d^{3}\right )} b{\left | -b c + a d \right |}} + \frac{{\left (\sqrt{-a^{2} + b^{2}} b c{\left | a - b \right |} + \sqrt{-a^{2} + b^{2}}{\left (a - 2 \, b\right )} d{\left | a - b \right |} - \sqrt{-a^{2} + b^{2}}{\left | -b c + a d \right |}{\left | a - b \right |}\right )}{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor + \arctan \left (\frac{2 \, \sqrt{\frac{1}{2}} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-\frac{2 \, a c - 2 \, b d - \sqrt{-4 \,{\left (a c + b c + a d + b d\right )}{\left (a c - b c - a d + b d\right )} + 4 \,{\left (a c - b d\right )}^{2}}}{a c - b c - a d + b d}}}\right )\right )}}{{\left (a^{2} - 2 \, a b + b^{2}\right )}{\left (b c - a d\right )}^{2} -{\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} c{\left | -b c + a d \right |} +{\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} d{\left | -b c + a d \right |}}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)/(a+b*sec(f*x+e))/(c+d*sec(f*x+e)),x, algorithm="giac")

[Out]

((sqrt(-c^2 + d^2)*b*(c - 2*d)*abs(c - d) + sqrt(-c^2 + d^2)*a*d*abs(c - d) + sqrt(-c^2 + d^2)*abs(-b*c + a*d)
*abs(c - d))*(pi*floor(1/2*(f*x + e)/pi + 1/2) + arctan(2*sqrt(1/2)*tan(1/2*f*x + 1/2*e)/sqrt(-(2*a*c - 2*b*d
+ sqrt(-4*(a*c + b*c + a*d + b*d)*(a*c - b*c - a*d + b*d) + 4*(a*c - b*d)^2))/(a*c - b*c - a*d + b*d))))/((b*c
 - a*d)^2*(c^2 - 2*c*d + d^2) + (c^3 - 2*c^2*d + c*d^2)*a*abs(-b*c + a*d) - (c^2*d - 2*c*d^2 + d^3)*b*abs(-b*c
 + a*d)) + (sqrt(-a^2 + b^2)*b*c*abs(a - b) + sqrt(-a^2 + b^2)*(a - 2*b)*d*abs(a - b) - sqrt(-a^2 + b^2)*abs(-
b*c + a*d)*abs(a - b))*(pi*floor(1/2*(f*x + e)/pi + 1/2) + arctan(2*sqrt(1/2)*tan(1/2*f*x + 1/2*e)/sqrt(-(2*a*
c - 2*b*d - sqrt(-4*(a*c + b*c + a*d + b*d)*(a*c - b*c - a*d + b*d) + 4*(a*c - b*d)^2))/(a*c - b*c - a*d + b*d
))))/((a^2 - 2*a*b + b^2)*(b*c - a*d)^2 - (a^3 - 2*a^2*b + a*b^2)*c*abs(-b*c + a*d) + (a^2*b - 2*a*b^2 + b^3)*
d*abs(-b*c + a*d)))/f